home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
extras
/
programm
/
gemfsc20
/
gemfsc20.lzh
/
GEMFUNCS
/
OBJGSPEC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-02-01
|
1KB
|
53 lines
/**************************************************************************
* OBJGSPEC.C - Get an object's ob_spec; handles INDIRECT & XUSERDEF objs.
*************************************************************************/
#include "gemfintl.h"
/*-------------------------------------------------------------------------
*
*-----------------------------------------------------------------------*/
long obj_gvalue(ptree, obj)
OBJECT *ptree;
short obj;
{
long obspec;
XUSERBLK *xub;
obspec = (long)ptree[obj].ob_spec;
if (ptree[obj].ob_flags & INDIRECT) {
obspec = *(long *)obspec;
}
if ((ptree[obj].ob_type & 0x00FF) == G_USERDEF) {
xub = (XUSERBLK *)obspec;
if (xub->ub_self == xub) {
obspec = (long)xub->ob_spec;
}
}
return obspec;
}
void obj_svalue(ptree, obj, newvalue)
OBJECT *ptree;
short obj;
long newvalue;
{
long *pspec;
XUSERBLK *xub;
pspec = (long*)&ptree[obj].ob_spec;
if (ptree[obj].ob_flags & INDIRECT) {
pspec = *(long **)pspec;
}
if ((ptree[obj].ob_type & 0x00FF) == G_USERDEF) {
xub = *(XUSERBLK **)pspec;
if (xub->ub_self == xub) {
pspec = *(long**)xub->ob_spec;
}
}
*pspec = newvalue;
}